package service

import (
	"github.com/gin-gonic/gin"
	"log"
	"server/internal/biz"
	"strconv"
)

type UserService struct {
	biz *biz.UserBiz
}

func NewUserService(biz *biz.UserBiz) *UserService {
	return &UserService{
		biz: biz,
	}
}

func (u *UserService) UserInfo(c *gin.Context) (*biz.UserDO, error) {
	userId, _ := strconv.Atoi(c.Query("userId"))
	log.Println("userId=", userId)
	return u.biz.GetUserById(userId)
}
